Expand description
§Mainline
Simple, robust, BitTorrent’s Mainline DHT implementation.
This library is focused on being the best and simplest Rust client for Mainline, especially focused on reliable and fast time-to-first-response.
It should work as a routing / storing node as well, but if you want to run a reliable node to support the network, you might be better off running libtorrent for now.
§Get started
Check the Examples.
§Features
§Client
Running as a client, means you can store and query for values on the DHT, but not accept any incoming requests.
use mainline::Dht;
let dht = Dht::client(); // or Dht::default();
Supported BEPs:
- BEP0005 DHT Protocol
- BEP0042 DHT Security extension
- BEP0043 Read-only DHT Nodes
- BEP0044 Storing arbitrary data in the DHT
§Server
Running as a server is the same as a client, but you also respond to incoming requests and serve as a routing and storing node, supporting the general routing of the DHT, and contributing to the storage capacity of the DHT.
use mainline::Dht;
let dht = Dht::server(); // or Dht::builder::as_server().build();
Supported BEPs:
- BEP0005 DHT Protocol
- BEP0042 DHT Security extension
- BEP0043 Read-only DHT Nodes
- BEP0044 Storing arbitrary data in the DHT
§Acknowledgment
This implementation was possible thanks to Webtorrent’s Bittorrent-dht as a reference, and Rustydht-lib that saved me a lot of time, especially at the serialization and deserialization of Bencode messages.
§Mainline
Rust implementation of read-only BitTorrent Mainline DHT client.
Re-exports§
pub use crate::error::Error;
pub use dht::Dht;
pub use dht::DhtSettings;
pub use dht::Testnet;
pub use crate::common::*;
pub use crate::rpc::response::*;
Modules§
- Dht node with async api.
- Miscellaneous common structs used throughout the library.
- Dht node.
- Main Crate Error
- Serealize and decerealize Krpc messages.
- K-RPC implementation